﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CaiyinSoft.NetGather.Protocol;

namespace CaiyinSoft.NetGather.NetGatherLib.URLSource
{
    public partial class SQLURLSourceForm : InnerFormBase
    {
        public SQLURLSourceForm()
        {
            InitializeComponent();
        }

        public SQLURLSource _URLSource;
        public SQLURLSource URLSource
        {
            get
            {
                if (_URLSource == null)
                {
                    return null;
                }
                else
                {
                    _URLSource.ConnectionStr = ConnectionStr;
                    _URLSource.TableName = TableName;
                    _URLSource.Order = Order;
                    return _URLSource;
                }
            }
            set
            {
                _URLSource = value;
                ConnectionStr = value.ConnectionStr;
                TableName = value.TableName;
                Order = value.Order;
            }
        }

        public string ConnectionStr
        {
            get
            {
                return txtConnectionStr.Text;
            }
            set
            {
                txtConnectionStr.Text = value;
            }
        }

        public string TableName
        {
            get
            {
                return txtTableName.Text;
            }
            set
            {
                txtTableName.Text = value;
            }
        }

        public string Order
        {
            get
            {
                return string.Format("{0}",cmbOrder.SelectedItem);
            }
            set
            {
                cmbOrder.SelectedItem = value;
            }
        }

        private void SQLURLSourceForm_Load(object sender, EventArgs e)
        {

        }
    }
}
